﻿using System;


// ReSharper disable CheckNamespace
namespace Stereotypes.Annotations
{

    /// <summary>
    /// Value object is a class that gets its state in the construction phase
    /// and then never changes it.
    /// </summary>
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = true)]
    [Serializable]
    public class ValueObjectAttribute : Attribute
    {}


    /// <summary>
    /// Datum is a class (or a struct) that just is a datum not a service.
    /// Datum must be a value object and contains no complex logic.
    /// Datum must not refer classes or services except ones it aggregates.
    /// Datum must implement equality operators.
    /// </summary>
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = true)]
    [Serializable]
    public class DatumAttribute : ValueObjectAttribute
    {}


    /// <summary>
    /// Entity is a class which instance relates to an object
    /// in the problematic area of our application;
    /// and each problematic object should be referred by only
    /// one entity instance; in other words, one entity instance
    /// for one real life object. (An exception is a transaction
    /// model where each opened transaction has own representation
    /// of one real life object.) So an instance can be equeal
    /// only to itself.
    /// </summary>
    [AttributeUsage(AttributeTargets.Class, Inherited = true)]
    [Serializable]
    public class EntityAttribute : Attribute 
    {}


    /// <summary>
    /// Service is a class that provides some logic procedures and functions.
    /// Service is not hired for hold data (except temporary).
    /// Services can be stateless or statefull.
    /// Statefull services also can be stable (when methods don't influence on ech other)
    /// or volatile (where methods behaviour depends on which methods with which parameters
    /// have been called before).
    /// Service usually should not implement equality operators.
    /// </summary>
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = true)]
    [Serializable]
    public class ServiceAttribute : Attribute
    {}


}